package com.jinlong.api.server;

import com.jinlong.entity.UserEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 用户服务
 */
@RequestMapping("/member")
public interface UserService {

    /**
     * 注册功能
     * @param userEntity
     * @return
     */
    @PostMapping("/regist")
    public Map<String,Object>regist(@RequestBody UserEntity userEntity);

    /**
     * 登陆功能
     * @return
     */
    @PostMapping("/login")
    public Map<String,Object>login(@RequestBody UserEntity userEntity);

    /**
     * 根据token获取用户信息
     * @param token
     * @return
     */
    @PostMapping("/getUser")
    public Map<String,Object>getUser(@RequestParam("token") String token);

    /**
     *
     * @methodDesc: 功能描述:(使用openid查找用户信息)
     * @param: @param
     *             token
     * @param: @return
     */
    @PostMapping("/findOpenId")
    public Map<String, Object> findLogin(@RequestParam("openid") String openid);
}
